-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Lookup altitude #1518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lookup altitude #1518
Conversation
FYI, I want to be more transparent about how I generated the altitude dataset. I'm trying to consolidate the generation into one python script so is easy for you guys to run it. I will probably release it as a Github Gist soon. Also, I want to do a better job quantifying the accuracy of the generated map. I will try to find a good source of ground truth for altitudes and release some error stats. |
There is a bug in the new implementation when numbers hit the boundaries
Removing extra empty line at the end of the file
Using new map so is reproducible with script https://gist.github.com/nicomt/d2c5f08a8ee3500550be42d8dbee6c1d
Here is the Gist I promised that allows you guys to reproduce the altitude map. While compiling the script, I realized that the lower altitude bound in my first commit was lower than the lowest place on earth (The Death Sea). In this version, I fixed the lower bound to Also, I compared the results with a few samples from the Google Elevation API, and here is what I got. It looks like the error is pretty bad in Greenland and Asia but relatively okay elsewhere.
Let me know if there is something else I can do to help. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test should move to test_tools.py
:
pvlib-python/pvlib/tests/test_clearsky.py
Line 514 in 3692427
def test_degrees_to_index_1(): |
Actually I don't understand why the test_clearsky.py
didn't generate a failure.
Small documentation change Co-authored-by: Cliff Hansen <[email protected]>
* Retuning float altitude instead of int * Removing h5 file input
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for this great PR @nicomt! I was able to successfully run your generation script using the requirements file (conda create -n altmap python=3.8 --file reqs.txt -c conda-forge
) and the output I got has the same md5 hash as the one in this PR 👍 LGTM other than the merge conflict.
It looks like the error is pretty bad in Greenland and Asia but relatively okay elsewhere.
At least for Greenland, maybe caused by whether the altitude is reported for the top of the ice sheet versus the underlying bedrock (tilezen/joerd#103)? I'd say let's not worry about it; anyone trying to build a solar farm on an ice sheet will be too distracted by other problems to complain about that error.
Thanks so much Nicolas, Two very minor nits that aren't blockers and can be improvements in future PR's, I don't want to hold up merging this asap.
|
@mikofski I will fix those in the next PR. Thanks |
docs/sphinx/source/reference
for API changes.docs/sphinx/source/whatsnew
for all changes. Includes link to the GitHub Issue with:issue:`1516`
or this Pull Request with:pull:`1518`
. Includes contributor name and/or GitHub username (link with:ghuser:`nicomt`
).remote-data
) and Milestone are assigned to the Pull Request and linked Issue.To make it easier to review, this pull request doesn't replace the default altitude in the
Location
class or theget_solarposition
yet.I will make another pull request once this one is merged.
One change to note is_degrees_to_index
; I simplified the function. I think a lot of the centering and floating point logic is unnecessary. I even compared the output over several thousands of random integers, and their outputs were identical.Let me know if you rather I change it back.
I changed it back to the original after I realized my new implementation had a bug at the boundaries.